]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: Avoid _onEvent() to be called twice
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 31 Jul 2014 15:26:47 +0000 (17:26 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 31 Jul 2014 15:43:09 +0000 (17:43 +0200)
Both Panel.ActivitiesButton and its parent class Panel.MenuButton would
attempt to connect their own _onEvent() function to Clutter::event,
which counterintuitively was connecting the child class' _onEvent()
function twice.

So, actually chain up on the signal handler, and don't connect twice
to the signal. Both methods were calling this.menu.close(), so only
do that on the parent class handler, since we're chaining up and doing
the right thing now.

https://bugzilla.gnome.org/show_bug.cgi?id=733840

js/ui/panel.js

index 10fe169c4d0f7cfc3345cbe3b062de61151a035f..3c2ab6bef96e4a979538d9b2cfaff0e3abfadb74 100644 (file)
@@ -571,7 +571,6 @@ const ActivitiesButton = new Lang.Class({
         this.actor.label_actor = this._label;
 
         this.actor.connect('captured-event', Lang.bind(this, this._onCapturedEvent));
-        this.actor.connect_after('event', Lang.bind(this, this._onEvent));
         this.actor.connect_after('key-release-event', Lang.bind(this, this._onKeyRelease));
 
         Main.overview.connect('showing', Lang.bind(this, function() {
@@ -609,12 +608,12 @@ const ActivitiesButton = new Lang.Class({
     },
 
     _onEvent: function(actor, event) {
-        if (event.type() == Clutter.EventType.TOUCH_END ||
-            event.type() == Clutter.EventType.BUTTON_RELEASE) {
+        this.parent(actor, event);
 
+        if (event.type() == Clutter.EventType.TOUCH_END ||
+            event.type() == Clutter.EventType.BUTTON_RELEASE)
             Main.overview.toggle();
-            this.menu.close();
-        }
+
         return Clutter.EVENT_PROPAGATE;
     },